# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
# RUN: llc -o - %s -run-pass=block-placement -mtriple=thumbv7k-apple-ios8.0.0 -verify-machineinstrs -O3 | FileCheck %s
---
# Make sure the bundle gets duplicated correctly
name: func
tracksRegLiveness: true
body: |
  ; CHECK-LABEL: name: func
  ; CHECK: bb.0:
  ; CHECK:   successors: %bb.3(0x40000000), %bb.2(0x40000000)
  ; CHECK:   liveins: $r0, $lr, $r7
  ; CHECK:   t2CMPri $r0, 32, 14 /* CC::al */, $noreg, implicit-def $cpsr
  ; CHECK:   BUNDLE implicit-def dead $itstate, implicit-def $cpsr, implicit killed $r0, implicit killed $cpsr {
  ; CHECK:     t2IT 1, 24, implicit-def $itstate
  ; CHECK:     t2CMPri killed $r0, 9, 1 /* CC::ne */, killed $cpsr, implicit-def $cpsr, implicit internal killed $itstate
  ; CHECK:   }
  ; CHECK:   t2Bcc %bb.3, 1 /* CC::ne */, killed $cpsr
  ; CHECK: bb.2:
  ; CHECK:   successors: %bb.3(0x40000000), %bb.2(0x40000000)
  ; CHECK:   $r0 = IMPLICIT_DEF
  ; CHECK:   t2CMPri $r0, 32, 14 /* CC::al */, $noreg, implicit-def $cpsr
  ; CHECK:   BUNDLE implicit-def dead $itstate, implicit-def $cpsr, implicit killed $r0, implicit killed $cpsr {
  ; CHECK:     t2IT 1, 24, implicit-def $itstate
  ; CHECK:     t2CMPri killed $r0, 9, 1 /* CC::ne */, killed $cpsr, implicit-def $cpsr, implicit internal killed $itstate
  ; CHECK:   }
  ; CHECK:   t2Bcc %bb.2, 0 /* CC::eq */, killed $cpsr
  ; CHECK: bb.3:
  ; CHECK:   successors: %bb.3(0x40000000), %bb.2(0x40000000)
  ; CHECK:   $r0 = IMPLICIT_DEF
  ; CHECK:   t2CMPri $r0, 32, 14 /* CC::al */, $noreg, implicit-def $cpsr
  ; CHECK:   BUNDLE implicit-def dead $itstate, implicit-def $cpsr, implicit killed $r0, implicit killed $cpsr {
  ; CHECK:     t2IT 1, 24, implicit-def $itstate
  ; CHECK:     t2CMPri killed $r0, 9, 1 /* CC::ne */, killed $cpsr, implicit-def $cpsr, implicit internal killed $itstate
  ; CHECK:   }
  ; CHECK:   t2Bcc %bb.3, 1 /* CC::ne */, killed $cpsr
  ; CHECK:   t2B %bb.2, 14 /* CC::al */, $noreg
  bb.0:
    liveins: $r0, $lr, $r7

  bb.1:
    liveins: $r0

    t2CMPri $r0, 32, 14, $noreg, implicit-def $cpsr
    BUNDLE implicit-def dead $itstate, implicit-def $cpsr, implicit killed $r0, implicit killed $cpsr {
      t2IT 1, 24, implicit-def $itstate
      t2CMPri killed $r0, 9, 1, killed $cpsr, implicit-def $cpsr, implicit internal killed $itstate
    }
    t2Bcc %bb.3, 1, killed $cpsr

  bb.2:
    $r0 = IMPLICIT_DEF
    t2B %bb.1, 14, $noreg

  bb.3:
    $r0 = IMPLICIT_DEF
    t2B %bb.1, 14, $noreg
...
